package com.js.lib_common.mvp.presenter;


import com.js.lib_common.base.BasePresenter;
import com.js.lib_common.mvp.view.UserInfoView;

/**
 * Created by wz on 2019/5/17.
 */
public class UserInfoPresenter extends BasePresenter<UserInfoView> {
    public UserInfoPresenter(UserInfoView view) {
        attachView(view);
    }


    public void getUserInfo() {

//        UserInfoRequest request=   new UserInfoRequest();
//
//        request.setToken(token);
//        request.setCmd("getinfo");
//
//        addSubscription(apiStores3.getUserInfo(request),
//                new ApiCallback<UserInfoResponse>() {
//                    @Override
//                    public void onSuccess(UserInfoResponse response) {
//                        Log.e("----",response.toString());
//                        if (response.getError()==0) {
////                            Gson gson = new Gson();
////                            String jsonStr = gson.toJson(response); //将对象转换成Json
////                            SPUtils.put(FlapDoorApplication.getAppContext(), "login", jsonStr);
////                            SPUtils.put(FlapDoorApplication.getAppContext(), "account", name);
////                            SPUtils.put(FlapDoorApplication.getAppContext(), "pwd", pwd);
//                            if (mvpView!=null) mvpView.onSuccess(response.getData());
//                        } else {     if (mvpView!=null)
//                            mvpView.onFail(response.getError()+"");
//                        }
//
//                    }
//
//                    @Override
//                    public void onFailure(String msg) {
//                        if (mvpView!=null)mvpView.onFail(msg);
//                    }
//
//
//                    @Override
//                    public void onFinish() {
//
//                    }
//
//                });
    }





}
